UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5goXbe6fO6I+dT3CRNfI4Q6P4NCiOVe8dFdGmvKUQhA='
WHERE
key_id = '525e1c1c60c0caa15ed3b80d1f44c7b659fba2efe88df54655136b64cf43aecd'
AND (
token = '5goXbe6fO6I+dT3CRNfI4Q6P4NCiOVe8dFdGmvKUQhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)