UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gOt48gAq0/mygZPSh3DLbRCa+xYNNKP6zhQQi2+9J7M=' 
WHERE 
  key_id = '26fe83bc3b2371a89f17d475f86f350a88f2403e45f2b7a04b9f89e309c5669f' 
  AND (
    token = 'gOt48gAq0/mygZPSh3DLbRCa+xYNNKP6zhQQi2+9J7M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047