UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+HfQ4hsm9YiPkKSWpkk7zVB0Q/ep0HH2RDV6+n6v6OY='
WHERE
key_id = 'bc0ba98d2f22b04421658106455286687356bc551ce5e49595a054edf5b3db54'
AND (
token = '+HfQ4hsm9YiPkKSWpkk7zVB0Q/ep0HH2RDV6+n6v6OY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)