UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fvLW8D8F+HovImkpj0fLaWlJPZvBHZ7PUOG7VqXZQzo='
WHERE
key_id = '431231d9307cea1f3228c8bd46a9bf9d1f7356986c8865e2589452da9b774b93'
AND (
token = 'fvLW8D8F+HovImkpj0fLaWlJPZvBHZ7PUOG7VqXZQzo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)