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

Query time 0.00037