UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cfvoo9ozYKOU7dt91O9CShzs6bure2hbEgedJfBCPmM='
WHERE
key_id = 'aa72c10ef2ef76b96df198018b8877d1d9b74a3f8d0c34f81fc3525ff3de297c'
AND (
token = 'Cfvoo9ozYKOU7dt91O9CShzs6bure2hbEgedJfBCPmM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)