UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eAqNVcaUEmbRr7fZqwWdQW8K42/DgDiYf5RcjX+Co/U='
WHERE
key_id = 'b968da931ee25954fa11a40eb3916ef65e3aa98ae5eb71298e445d49acf39cd2'
AND (
token = 'eAqNVcaUEmbRr7fZqwWdQW8K42/DgDiYf5RcjX+Co/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)