UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4AThwlHqZHH67uN4/hIee143D7lnTuQJGPpAr1KwgII=' 
WHERE 
  key_id = '70258a0a5ab375be3e00d468fd08098536474d5d2679c90968eebafa1e937b0f' 
  AND (
    token = '4AThwlHqZHH67uN4/hIee143D7lnTuQJGPpAr1KwgII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045