UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'taPFVWJgqmwRh+oo9Bmlpi5HmiUW2TfHQV0YckzhcjQ=' 
WHERE 
  key_id = '93a5f1e48d1e83d4d653ee1632e38e00d82a73a1e79750e4aca812461449c4d1' 
  AND (
    token = 'taPFVWJgqmwRh+oo9Bmlpi5HmiUW2TfHQV0YckzhcjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046