UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9mrtiv2PVG2Aq1uKXxMSqaiGK65TPVq+atpkxT4Ip+U='
WHERE
key_id = '62c8742f83f269568770c7cf58fcc9fe7cad8dfa1ae50411b4b7c4049b1139cc'
AND (
token = '9mrtiv2PVG2Aq1uKXxMSqaiGK65TPVq+atpkxT4Ip+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)