UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2X/0E0FFoVYU//Rp+rcuA0oL4/YDHRIkz2QxNpnpR4='
WHERE
key_id = '6a8dd04072cb08094cc41c62f224822765c9f1646f89c1215a470445700961ad'
AND (
token = 's2X/0E0FFoVYU//Rp+rcuA0oL4/YDHRIkz2QxNpnpR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)