UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V6G7MzwUIKv0HHSdiJASeuz6j1RuINcNzbPxBJ/5DfQ=' 
WHERE 
  key_id = '85463002e65fadd9f25b7f5a30f9a4ea7df8edd489c04654a847959690aa957e' 
  AND (
    token = 'V6G7MzwUIKv0HHSdiJASeuz6j1RuINcNzbPxBJ/5DfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033