UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cyvfgRraI/0UCewmAGYMpApoRc3TGJXgU+qLiJQEc44='
WHERE
key_id = '88125b04ed92f66bb4a525c50dfb47c5867b87a6ecb3277862817185f8bf07f2'
AND (
token = 'cyvfgRraI/0UCewmAGYMpApoRc3TGJXgU+qLiJQEc44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)