UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'elLmu7K0dlBc7xBHLNTs7OExh0n8+Icifj47wrcsr0c='
WHERE
key_id = 'b5979ca44eaaca3a9a36de4eee2603fd15b846fc492a0eaa07d16c2ef62ec1e8'
AND (
token = 'elLmu7K0dlBc7xBHLNTs7OExh0n8+Icifj47wrcsr0c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)