UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uIeyKlBJY532myrUUt7E4VA4ortffKcrzhvfu9KJgLQ='
WHERE
key_id = '1fff8b5fa3924f1fec5a542a621d63322c659f56f2f21c798e04f9d6601432b6'
AND (
token = 'uIeyKlBJY532myrUUt7E4VA4ortffKcrzhvfu9KJgLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)