UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xwekcY+nvWsj7sfwwydAL49QMy+Oc1AvcxbKaMxyy/8=' 
WHERE 
  key_id = '130cfce539875242eb24281c9188f7ff3cc14d68f4091b05ce0dadebba634953' 
  AND (
    token = 'xwekcY+nvWsj7sfwwydAL49QMy+Oc1AvcxbKaMxyy/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029