UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1DfuxGN8DR2orURzRd+UREnhEMXm4jkhPJsfDNSK8lE='
WHERE
key_id = '3801d503ad51a1236cb6b1e71dfa3517aa0531ac16f9392362a12080c05020e5'
AND (
token = '1DfuxGN8DR2orURzRd+UREnhEMXm4jkhPJsfDNSK8lE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)