UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xo8EJNPq7IrzxvnhrNf7V81EIIzUj3CC6d8EGCz1YXU='
WHERE
key_id = '9f28c8d5bde19f981fbb750729caaadeaa024714de59e6f34848ca43e44e7c1e'
AND (
token = 'xo8EJNPq7IrzxvnhrNf7V81EIIzUj3CC6d8EGCz1YXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)