UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X5vWwn0Bly2KP2lCoYnKioShXiHLNDqYR5tQ7XSDC0k=' 
WHERE 
  key_id = 'fa02811d9814ccf08fcfc3f7aea6f0548cb25bb63fd067e929e1024a98ee5c75' 
  AND (
    token = 'X5vWwn0Bly2KP2lCoYnKioShXiHLNDqYR5tQ7XSDC0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034