UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u/W0DveyvwOATcMUSU9rNSCSCX5UAwEq0PpRuHrAWmY='
WHERE
key_id = 'f0a1bd84296a1e817fbcab872cccf6cf0687734cd055ec54f495473789eb82fb'
AND (
token = 'u/W0DveyvwOATcMUSU9rNSCSCX5UAwEq0PpRuHrAWmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)