UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5tWgjiNPBwEGINyJyLqX6Ejtlx+xJzcUsNd71Et9rG8='
WHERE
key_id = '53cad084d7888c35e00cf9d829b77b4e173ee1a0f79009626248702bdd8e5dcb'
AND (
token = '5tWgjiNPBwEGINyJyLqX6Ejtlx+xJzcUsNd71Et9rG8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)