UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9i8Wl84h5+fjgGTeDy5PQx6mmQdE1Dj89YTOlWXgNns='
WHERE
key_id = '0a8feab843ab1491a63e7aa557082eec4d01aaf2970e40f0f4b0b07bb1f7e133'
AND (
token = '9i8Wl84h5+fjgGTeDy5PQx6mmQdE1Dj89YTOlWXgNns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)