UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ua5a5jHZuBQyKgORvS3vcrZAIzFMJEHLPEtWumCUyTw=' 
WHERE 
  key_id = '182d0e16a1714ec5ede4d615777599a5b426f7dc02f0e38fb2ed20a7e8a6ea87' 
  AND (
    token = 'ua5a5jHZuBQyKgORvS3vcrZAIzFMJEHLPEtWumCUyTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029