UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o69ELhNtfZ+h0nDYqnhSAHvmT+ZTXqOI3CYIUeGylWg='
WHERE
key_id = '6acfed724105a9fbc08315398d815d7eb8938633e0e0594292c4dcae3aef0a9e'
AND (
token = 'o69ELhNtfZ+h0nDYqnhSAHvmT+ZTXqOI3CYIUeGylWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)