UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hjEJSx4Au3PkebtjLjLiQRpgkNf2t5UH8YReyBWzdo0='
WHERE
key_id = '4df7cc81b9e9fc4bf5658f5dd001251c742935b6a3a208c9cae18cba7e385820'
AND (
token = 'hjEJSx4Au3PkebtjLjLiQRpgkNf2t5UH8YReyBWzdo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)