UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G46mXp3Nicce/8c81zPlrGLkAXX1kbyMSyOiJ5kTiGU='
WHERE
key_id = '74f96825e23a2a0ad864210f49902bd23642db2c2cb1ee7be5daf32ca0f0700d'
AND (
token = 'G46mXp3Nicce/8c81zPlrGLkAXX1kbyMSyOiJ5kTiGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)