UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oKrRHY5fdntz0wcbAb2uUonRS5HlQ+EhV0V9D6tdF5k=' 
WHERE 
  key_id = '3b8e3eb7d1317a54c8063fbef2b2bdde03660cd015394ac48f7f6f1805be8c1a' 
  AND (
    token = 'oKrRHY5fdntz0wcbAb2uUonRS5HlQ+EhV0V9D6tdF5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033