UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jt+8npdAGYUWXXA2cDeJuNInZp+0dHb1WXPwLI3zFMk='
WHERE
key_id = 'e3b720cc6134348dd557a5ed3608aacdd67984c6ee001d43968d64baf2f1b07f'
AND (
token = 'Jt+8npdAGYUWXXA2cDeJuNInZp+0dHb1WXPwLI3zFMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)