UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NqfOoGKUBYIoTFQbJ0K+oyNmbXxL0k29GbUSFmXLohc='
WHERE
key_id = '3ed53cb07ca2232403a9d98dfd19886f57783ae206f8eedc7486cb0732a1a7b3'
AND (
token = 'NqfOoGKUBYIoTFQbJ0K+oyNmbXxL0k29GbUSFmXLohc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)