UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'drkK0Qnc3ixMhBHTvaqf9l24RbqEo2kq91lGLkC3yAY='
WHERE
key_id = 'ed37cdae6cff77b27a61055cf6a1bb6f23c788bec40466f0c78ea91a40cacd18'
AND (
token = 'drkK0Qnc3ixMhBHTvaqf9l24RbqEo2kq91lGLkC3yAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)