UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WMFObD7rnZjDElsFHm33cmLmxk+0kLcTXvY2zMmS1sk=' 
WHERE 
  key_id = 'b0a0ce41b7bd45f58c4e0c06088ae1e471e74a6f60b22626ac749d8083ba0bd4' 
  AND (
    token = 'WMFObD7rnZjDElsFHm33cmLmxk+0kLcTXvY2zMmS1sk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016