UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nhhVnAFnixZoHOo0N9g8Z/op/t1h/0hlVGlgr1vl/ic=' 
WHERE 
  key_id = 'b96518fbf8dd6b64b6599f75047949f45dfeffcd90636852da731ffa22814e0c' 
  AND (
    token = 'nhhVnAFnixZoHOo0N9g8Z/op/t1h/0hlVGlgr1vl/ic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029