UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qu4eIeShR0O6+0zUjPwbZr9QqI0fDcjvCp3OBPMUe3s='
WHERE
key_id = 'bcf3eb8a953c722bb57509cc72b677d053b65868258e2b279f77035e00cbd706'
AND (
token = 'qu4eIeShR0O6+0zUjPwbZr9QqI0fDcjvCp3OBPMUe3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)