UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UwJDYgtbVBSNIBBkAtNdLin26Ky6pOP4+5eIGQJ9+FE='
WHERE
key_id = '89c0363ceb1a935385e79d0c0965dc331e28e0f01d36f4126b401a29805e57e4'
AND (
token = 'UwJDYgtbVBSNIBBkAtNdLin26Ky6pOP4+5eIGQJ9+FE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)