UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4S+tsCZaJ/k43uB60d6AIn9ehvsTMxKAfRGjhLqNnvc='
WHERE
key_id = '2ecfb7e4ae137c5d9f800d37ef59ae6c058a60ce74948bcc07ddabcfcb7f51b4'
AND (
token = '4S+tsCZaJ/k43uB60d6AIn9ehvsTMxKAfRGjhLqNnvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)