UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Da0guIIDVgbxMTStiWUXNPY1sBqBCYkbTc1lQa4Yydo='
WHERE
key_id = '5507cf815417674136c625218e42b6b1c9035aa0524551c89c6a7eeb6a842218'
AND (
token = 'Da0guIIDVgbxMTStiWUXNPY1sBqBCYkbTc1lQa4Yydo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)