UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gEP2yMaAUL3tJtJ9v1MljReB+DOvJIZxMZfnhsVVMZI='
WHERE
key_id = '74a71923f1d2cb50fca6d2069435986eadc8a52bed269b7e893ad7f66ca463da'
AND (
token = 'gEP2yMaAUL3tJtJ9v1MljReB+DOvJIZxMZfnhsVVMZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)