UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bKWjFSvNr8qGAZ3s/rpmcViYkWUySWTBiqM0Tpiscmc='
WHERE
key_id = '4e746d01edb2fba8c24d26018123abc627181692b2f0404cddcf5a736e087d37'
AND (
token = 'bKWjFSvNr8qGAZ3s/rpmcViYkWUySWTBiqM0Tpiscmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)