UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iM2eMY9sVLaIXEKXoaHz+YUp0mTTbiJZaJ6U0GNvUFQ='
WHERE
key_id = '58f01b46062cb0748c1352b6a30945b27d7fe6326536775cffad0a1dcfe8f3ba'
AND (
token = 'iM2eMY9sVLaIXEKXoaHz+YUp0mTTbiJZaJ6U0GNvUFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)