UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fP+FkNUL+2ZZ+sUs4Jt8G69ODQQlIGmUhXvshKoLkP8='
WHERE
key_id = 'a3e2bd16b0d5d74ad18327768d714e2f3c27f4313e6452bd3e495afdcbc8e63b'
AND (
token = 'fP+FkNUL+2ZZ+sUs4Jt8G69ODQQlIGmUhXvshKoLkP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)